-
Notifications
You must be signed in to change notification settings - Fork 60
Add portable-atomic Feature
#91
base: master
Are you sure you want to change the base?
Conversation
|
|
# Objective - Contributes to #15460 ## Solution - Added the following features: - `std` (default) - `smol_str` (default) - `portable-atomic` - `critical-section` - `libm` - Fixed an existing issue where `bevy_reflect` wasn't properly feature gated. ## Testing - CI ## Notes - There were some minor issues with `bevy_math` and `bevy_ecs` noticed in this PR which I have also resolved here. I can split these out if desired, but I've left them here for now as they're very small changes and I don't consider this PR itself to be very controversial. - `libm`, `portable-atomic`, and `critical-section` are shortcuts to enable the relevant features in dependencies, making the usage of this crate on atomically challenged platforms possible and simpler. - `smol_str` is gated as it doesn't support atomically challenged platforms (e.g., Raspberry Pi Pico). I have an issue and a [PR](rust-analyzer/smol_str#91) to discuss this upstream.
# Objective - Contributes to bevyengine#15460 ## Solution - Added the following features: - `std` (default) - `smol_str` (default) - `portable-atomic` - `critical-section` - `libm` - Fixed an existing issue where `bevy_reflect` wasn't properly feature gated. ## Testing - CI ## Notes - There were some minor issues with `bevy_math` and `bevy_ecs` noticed in this PR which I have also resolved here. I can split these out if desired, but I've left them here for now as they're very small changes and I don't consider this PR itself to be very controversial. - `libm`, `portable-atomic`, and `critical-section` are shortcuts to enable the relevant features in dependencies, making the usage of this crate on atomically challenged platforms possible and simpler. - `smol_str` is gated as it doesn't support atomically challenged platforms (e.g., Raspberry Pi Pico). I have an issue and a [PR](rust-analyzer/smol_str#91) to discuss this upstream.
|
Resolved CI issue by checking for I have confirmed this adds support for cargo check --target thumbv6m-none-eabi --no-default-features --features portable-atomic,portable-atomic/unsafe-assume-single-core |
|
Finally, I've put |
# Objective - Contributes to bevyengine#15460 ## Solution - Added the following features: - `std` (default) - `smol_str` (default) - `portable-atomic` - `critical-section` - `libm` - Fixed an existing issue where `bevy_reflect` wasn't properly feature gated. ## Testing - CI ## Notes - There were some minor issues with `bevy_math` and `bevy_ecs` noticed in this PR which I have also resolved here. I can split these out if desired, but I've left them here for now as they're very small changes and I don't consider this PR itself to be very controversial. - `libm`, `portable-atomic`, and `critical-section` are shortcuts to enable the relevant features in dependencies, making the usage of this crate on atomically challenged platforms possible and simpler. - `smol_str` is gated as it doesn't support atomically challenged platforms (e.g., Raspberry Pi Pico). I have an issue and a [PR](rust-analyzer/smol_str#91) to discuss this upstream.
Implicitly relied on `serde/alloc`, causing compilation failure when that feature wasn't active.
Allows compilation on platforms without native support for `Arc` without the `portable-atomic` feature, at the expense of more expensive clones and comparisons.
Objective
thumbv6m-none-eabiviaportable-atomic#90serdeimplementation whereserde/allocwas implicitly relied onborshimplementationDescription
Added
portable-atomicfeature, which brings inportable-atomicandportable-atomic-utilas a compatibility shim forArcsupport on atomically challenged platforms, such asthumbv6m-none-eabi.On platforms with
targer_has_atomic = "ptr"(typical), this feature does nothing.Also allow compilation to succeed on such platforms by falling back onto
alloc::boxed::Boxas an alternative toArc. This fallback will have reduced runtime performance for clones and comparisons, but will work on all targets without any features enabled.Testing
cargo check --no-default-features --target thumbv6m-none-eabi --features portable-atomic,portable-atomic/fallback,portable-atomic/critical-sectionNotes
This is my first attempt at contributing to this project. Please let me know if there's anything I can do to assist with reviewing this change!